package com.ae.shield.common.items;

import com.ae.shield.AEShieldMod;
import net.minecraft.client.renderer.color.IItemColor;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.world.World;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class NonFunctionItem extends Item{
    private final boolean immuneFire;
    private final ArrayList<ITextComponent> tips = new ArrayList<>();

    public NonFunctionItem() {
        this(64, false);
    }

    public NonFunctionItem(ITextComponent... tip) {
        this();
        tips.addAll(Arrays.asList(tip));
    }

    public NonFunctionItem(int stackSize, boolean immuneFire) {
        super(new Properties().group(AEShieldMod.AE_SHIELD).maxStackSize(stackSize));
        this.immuneFire = immuneFire;
    }

    @Override
    public boolean isImmuneToFire() {
        return immuneFire;
    }

    @Override
    public void addInformation(@Nonnull ItemStack stack, @Nullable World worldIn, @Nonnull List<ITextComponent> tooltip, @Nonnull ITooltipFlag flagIn) {
        if (!tips.isEmpty()) {
            tooltip.addAll(tips);
        }
    }


}
